package com.ma.server.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ma.Dao.AdminDao;
import com.ma.entity.Admin;
import com.ma.entity.Student;
import com.ma.entity.Teacher;
import com.ma.server.AdminServer;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ProjectName: project
 * @Package: com.ma.server.Impl
 * @ClassName: AdminServerImpl
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/4/8 0:04
 * @Version: 1.0
 */
@Service
@Transactional
public class AdminServerImpl implements AdminServer {

    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin findAdmin(Admin admin) {
        Admin adminLogin = adminDao.findAdmin(admin);
        return adminLogin;
    }

    @Override
    public Integer addStudent(Student student) {
        return adminDao.addStudent(student);
    }

    @Override
    public List<Student> findAllStudents() {
        return adminDao.findAllStudents();
    }

    @Override
    public Integer deleteStudents(String number) {

        return adminDao.deleteStudents(number);
    }

    @Override
    public List<Teacher> findAllTeacher() {

        return adminDao.findAllTeacher();
    }

    @Override
    public Integer addTeacher(Teacher teacher) {
        return adminDao.addTeacher(teacher);
    }
}
